home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #ifdef AMIGA
- #include <gfxamiga.h>
- #else
- #include <gfx.h>
- #endif
-
- help()
- {
- printf("print text on the grafic screen\n");
- printf("tpo x y [options] -t text\n");
- printf("options:\n");
- printf(" -w n gives angle in degree\n");
- printf(" -xs n sets size of characters (integers)\n");
- printf(" -ys n sets size of characters (integers)\n");
- printf(" -xt n sets repetition (thicknes) for x\n");
- printf(" -yt n sets repetition (thicknes) for y\n");
- printf(" -font name sets fontname\n");
- printf(" -c n sets paper and ink colour\n");
- exit(0);
- }
-
- main(argc,argv)
- int argc;
- char *argv[];
- {
- int x,y,i,n,
- xsize=0,
- ysize=0,
- xthick=0,
- ythick=0,
- angle=0,
- colour=0;
- char s[80],fontname[80];
-
- fontname[0]=0;
- if(!checkopt(argc,argv,"-t",s)) help();
- if(checkopt(argc,argv,"-w",s)) angle=atoi(s);
- if(checkopt(argc,argv,"-xs",s)) xsize=atoi(s);
- if(checkopt(argc,argv,"-ys",s)) ysize=atoi(s);
- if(checkopt(argc,argv,"-xt",s)) xthick=atoi(s);
- if(checkopt(argc,argv,"-yt",s)) ythick=atoi(s);
- if(checkopt(argc,argv,"-font",s)) strcpy(fontname,s);
- if(checkopt(argc,argv,"-c",s)) colour=atoi(s);
-
- tekopen();
- textparam(xsize,ysize,xthick,ythick,angle,fontname);
- if(colour>0) setcolour(colour);
-
- x=atoi(argv[1]);
- y=atoi(argv[2]);
-
- strcpy(s,"");
- n=0;
- while(strcmp(argv[n],"-t")!=0) n++;
- for(i=n+1;i<argc;i++) {
- strcat(s," ");
- strcat(s,argv[i]);
- }
- posita(x,y);
- gfxtext(s,0.0);
- gfxflush();
- close(_tek4014);
- exit(0);
- }
-